﻿using Inaction;
using Inaction.Core;
using Inaction.Criteria;
using Inaction.Mapping;
using Inaction.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;

namespace Inaction
{
    public abstract partial class Entity<T> : IPropertyTrack
    {
        private object[] propertyTracks = null;
        [Browsable(false)]
        protected object[] PropertyTracks
        {
            get
            {
                if (propertyTracks == null)
                {
                    propertyTracks = new object[ClassInfo.Properties.Count];
                }
                return propertyTracks;
            }
        }
        public void PropertyTrack()
        {
            foreach (var p in ClassInfo.Properties)
            {
                PropertyTracks[p.Index] = p.GetFieldValue(this);
            }
        }
    }
}